package com.tensquare.recruit.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import com.tensquare.recruit.pojo.Recruit;

import java.util.List;

/**
 * 数据访问接口
 * @author Administrator
 *
 */
public interface RecruitDao extends JpaRepository<Recruit,String>,JpaSpecificationExecutor<Recruit>{
    //按照SpringDataJpa 方法名称 命名规范定义  以findBy开头
    //查询state为2的四条记录,根据创建日期倒序排序
    public List<Recruit> findTop4ByStateOrderByCreatetimeDesc(String state);
    //查询最新12个职位,查询state值不为0的数据,并按照日期正序排序
    public List<Recruit> findTop12ByStateNotOrderByCreatetimeAsc(String state);
}
